/*
 * @filename GatewayCurrentUserService.java
 * @author barry
 * @version 0.0.1
 * @date 2020年3月13日
 */
package cn.com.lms.business.user.service;

import cn.com.lms.business.core.util.SystemUserUtil;
import com.bnzj.cloud.business.core.service.SysUserService;
import com.bnzj.core.rest.CurrentUserService;
import com.bnzj.core.rest.UserInfo;
import com.bnzj.core.webmvc.util.WebMvcUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author barry
 * @date 2020-03-13
 */
@Component
public class GatewayCurrentUserService implements CurrentUserService {


    @Resource
    private SysUserService sysUserService;

    @Override
    public String getAccount() {
        return SystemUserUtil.getCurrentUser().getAccount();
    }

    @Override
    public UserInfo getUserInfo() {
        return sysUserService.findByAccount(getAccount());
    }
}
